home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gwu / adaed / math / constant.ads next >
Encoding:
Text File  |  1996-01-30  |  5.5 KB  |  162 lines

  1. --  -----------------------------------------------------------------------
  2. --  Title:       math_constants
  3. --  Last Mod:    Thu Apr 19 11:25:09 1990
  4. --  Author:      Vincent Broman <broman@nosc.mil>
  5. --   Copyright 1990 Vincent Broman
  6. --     Permission granted to copy, modify, or compile this software for
  7. --   one's own use, provided that this copyright notice is preserved intact.
  8. --     Permission granted to distribute compiled binary copies of this
  9. --   software which are linked in with some other application.
  10. --     Permission granted to distribute other copies of this software,
  11. --   provided that (1) any copy which is not source code, i.e. not in the
  12. --   form in which the software is usually maintained, must be accompanied
  13. --   by a copy of the source code from which it was compiled, and (2) the
  14. --   one distributing it must refrain from imposing on the recipient
  15. --   further restrictions on the distribution of this software.
  16. --   
  17. --  Visibility:  Imports nothing.  Withed by most things doing
  18. --         floating point math.
  19. --  Description:
  20. --      Definition of common named floating-point numbers.
  21. --
  22. --    The choice of constants included and the choice of their names
  23. --    were influenced by the Verdix math library spec and by an
  24. --      Elementary Function Package, written by Bruno Witte (retired)
  25. --      of the Naval Ocean Systems Center, San Diego, CA.
  26. --
  27. --      Constant values rounded to 40D have been taken from
  28. --      runs of the Unix programs bc and macsyma, and from
  29. --      Math. Comp. v34, (apr 1980), p559.
  30. --
  31. --  Exceptions:  None.
  32. --  -----------------------------------------------------------------------
  33. --
  34. package math_constants is
  35. -- 
  36.     pi: constant
  37.         :=  3.14159_26535_89793_23846_26433_83279_50288_4197;
  38.     exp_1: constant
  39.         :=  2.71828_18284_59045_23536_02874_71352_66249_7757;
  40.  
  41.     sin_1: constant
  42.         :=  0.84147_09848_07896_50665_25023_21630_29899_96226;
  43.     cos_1: constant
  44.         :=  0.54030_23058_68139_71740_09366_07442_97660_37323;
  45.     tan_1: constant
  46.         :=  1.55740_77246_54902_23050_69748_07458_36017_3087;
  47.  
  48.     sinh_1: constant
  49.         :=  1.17520_11936_43801_45688_23818_50595_60081_5156;
  50.     cosh_1: constant
  51.         :=  1.54308_06348_15243_77847_79056_20757_06168_2602;
  52.     tanh_1: constant
  53.         :=  0.76159_41559_55764_88811_94582_82604_79359_04128;
  54. --
  55. -- Roots
  56. --
  57.     sqrt_2: constant
  58.         :=  1.41421_35623_73095_04880_16887_24209_69807_8569;
  59.     sqrt_3: constant
  60.         :=  1.73205_08075_68877_29352_74463_41505_87236_6943;
  61.     sqrt_5: constant
  62.         :=  2.23606_79774_99789_69640_91736_68731_27623_5441;
  63.     sqrt_7: constant
  64.         :=  2.64575_13110_64590_59050_16157_53639_26042_5710;
  65.     sqrt_10: constant
  66.         :=  3.16227_76601_68379_33199_88935_44432_71853_3720;
  67.     sqrt_pi: constant
  68.         :=  1.77245_38509_05516_02729_81674_83341_14518_2798;
  69.     sqrt_two_pi: constant
  70.         :=  2.50662_82746_31000_50241_57652_84811_04525_3007;
  71. --
  72.     cbrt_2: constant
  73.         :=  1.25992_10498_94873_16476_72106_07278_22835_0570;
  74.     cbrt_3: constant
  75.         :=  1.44224_95703_07408_38232_16383_10780_10958_8392;
  76.     cbrt_4: constant
  77.         :=  1.58740_10519_68199_47475_17056_39272_30826_0391;
  78.     cbrt_10: constant
  79.         :=  2.15443_46900_31883_72175_92935_66519_35049_5259;
  80.     fourth_rt_2: constant
  81.         :=  1.18920_71150_02721_06671_74999_70560_47591_5293;
  82.     fourth_rt_10: constant
  83.         :=  1.77827_94100_38922_80122_54211_95192_68484_4736;
  84.     twelfth_rt_2: constant
  85.         :=  1.05946_30943_59295_26456_18252_94946_34170_0779;
  86. --
  87. -- Powers of e
  88. --
  89.     exp_2: constant
  90.         :=  7.38905_60989_30650_22723_04274_60575_00781_3180; 
  91.     exp_e: constant
  92.         := 15.15426_22414_79264_18976_04302_72629_91190_553;
  93.     exp_pi: constant
  94.         := 23.14069_26327_79269_00572_90863_67948_54738_027;
  95.     exp_half_pi: constant
  96.         :=  4.81047_73809_65351_65547_30356_66703_83312_6390;
  97.     exp_4th_pi: constant
  98.         :=  2.19328_00507_38015_45655_97696_59278_73822_3462;
  99. --
  100. -- Logarithms to base e, 10, 2
  101. --
  102.     nat_log_2: constant
  103.         :=  0.69314_71805_59945_30941_72321_21458_17656_80755;
  104.     nat_log_3: constant
  105.         :=  1.09861_22886_68109_69139_52452_36922_52570_4647;
  106.     nat_log_10: constant
  107.         :=  2.30258_50929_94045_68401_79914_54684_36420_7601;
  108.     nat_log_e: constant
  109.         :=  1.0;
  110.     nat_log_pi: constant
  111.         :=  1.14472_98858_49400_17414_34273_51353_05871_1647;
  112. --
  113.     com_log_2: constant
  114.         :=  nat_log_2  / nat_log_10;
  115.     com_log_3: constant
  116.         :=  nat_log_3  / nat_log_10;
  117.     com_log_10: constant
  118.         :=  1.0;
  119.     com_log_e: constant
  120.         :=  nat_log_e  / nat_log_10;
  121.     com_log_pi: constant
  122.         :=  nat_log_pi / nat_log_10;
  123. --
  124.     bin_log_2: constant
  125.         :=  1.0;
  126.     bin_log_3: constant
  127.         :=  nat_log_3  / nat_log_2;
  128.     bin_log_10: constant
  129.         :=  nat_log_10 / nat_log_2;
  130.     bin_log_e: constant
  131.         :=  nat_log_e  / nat_log_2;
  132.     bin_log_pi: constant
  133.         :=  nat_log_pi / nat_log_2;
  134. --
  135. -- Golden ratio
  136. --
  137.     golden_ratio: constant
  138.         :=  1.61803_39887_49894_84820_45868_34365_63811_7720;
  139.     nat_log_phi: constant
  140.         :=  0.48121_18250_59603_44749_77589_13424_36842_31352;
  141. --
  142. -- Euler's constant, gamma
  143. --
  144.     gamma: constant
  145.         :=  0.57721_56649_01532_86060_65120_90082_40243_10422;
  146.     nat_log_gamma: constant
  147.         := -0.54953_93129_81644_82233_76617_68802_90778_83307;
  148.     exp_gamma: constant
  149.         :=  1.78107_24179_90197_98523_65041_03107_17954_9170;
  150. --
  151. -- values of the Riemann Zeta function
  152. --
  153.     zeta_3: constant
  154.             :=  1.20205_69031_59594_28539_97381_61511_44999_0765;
  155.     zeta_5: constant
  156.         :=  1.03692_77551_43369_92633_13654_86457_03416_8057;
  157.  
  158. --
  159. end math_constants;
  160.  
  161. -- $Header: math_constants_s.ada,v 3.13 90/04/19 12:34:16 broman Rel $
  162.